package org.ndot.java.util;

import java.io.IOException;
import java.io.PrintStream;
import java.util.LinkedList;
import java.util.Queue;

/**
 * 【小蚂蚁学堂 - J2SE_Study】
 * 
 * 项目名称：J2SE_Study
 * 
 * 文件名：TestQueue.java
 * 
 * 功 能:
 *
 * 
 * 作 者: SunJincheng
 * 
 * 创建时间: 2010-4-8
 * 
 */
public class TestQueue {
	public Queue q;

	   public TestQueue() {
	     q = new LinkedList();
	   }

	   public void testFIFO(PrintStream out) throws IOException {
	     q.offer("First");
	     q.offer("Second");
	     q.offer("Third");

	     Object o;
	     while ((o = q.poll()) != null) {
	       out.println(o);
	     }
	   }

	   public static void main(String[] args) {
		   TestQueue tester = new TestQueue();

	     try {
	       tester.testFIFO(System.out);
	     } catch (IOException e) {
	       e.printStackTrace();
	     } 
	   }


}
